package com.qiaofang.collectmanage.constants;

import java.util.Arrays;
/**
 * Copyright (C), 2002-2017, 上海巧房信息技术有限公司
 * FileName: CollectRuleFieldEnum
 * @Author:   yi.li
 * Date:     2018/7/6 16:53
 * Description: 采集规则字段
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
public enum CollectRuleFieldEnum {

    ID("id","id值"),
    UUID("uuid","外键"),
    CITY("city","采集城市"),
    SOURCE("source","采集网站"),
    BELONGER("belonger","归属人"),
    COLLECT_HOUSE_TYPE("collectHouseType","房屋类型"),
    COLLECT_TYPE("collectType","采集类型"),
    WEBSITE("website","采集URL"),
    REQUEST_DETAIL_URL("requestDetailUrl","采集详情真实请求URL"),
    LIST_WEB_CODE("listWebCode","列表页编码"),
    DETAIL_WEB_CODE("detailWebCode","详情页编码"),
    DEFAULT_PAGES("defaultPages","默认采集页数"),
    TOPIC_NAME("topicName","kafka topic"),
    DELETED("deleted","是否已经被逻辑删除"),
    CREATED_USER_ID("createdUserId","创建人"),
    CREATED_TIME("createdTime","创建时间"),
    UPDATED_USER_ID("updatedUserId","更新人"),
    UPDATED_TIME("updatedTime","更新时间");

    /**
     * 枚举值
     */
    private String value;
    private String desc;

    CollectRuleFieldEnum(String value,String desc) {
        this.value = value;
        this.desc = desc;
    }
    /**
     * 判断是否存在枚举value
     */
    public static boolean valueExist(String value) {
        return Arrays.stream(CollectRuleFieldEnum.values()).anyMatch(obj -> obj.getValue().equals(value));
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

}
